﻿using System;
using System.Collections.Generic;
using System.Xml.Linq;

namespace Songhay.Wpf.UriTree.Models
{
    /// <summary>
    /// Defines an OPML set of data.
    /// </summary>
    public interface IOpmlSet
    {
        /// <summary>
        /// Gets the error message.
        /// </summary>
        /// <value>The error message.</value>
        string ErrorMessage { get; }

        /// <summary>
        /// Gets a value indicating whether the underlying OPML file is loaded.
        /// </summary>
        /// <value><c>true</c> if the underlying OPML file is loaded; otherwise, <c>false</c>.</value>
        bool FileIsLoaded { get; }

        /// <summary>
        /// Gets a value indicating whether an attempt to load the underlying OPML file was made.
        /// </summary>
        /// <value><c>true</c> if an attempt to load the underlying OPML file was made; otherwise, <c>false</c>.</value>
        bool FileLoadAttempted { get; }

        /// <summary>
        /// Gets a value indicating whether the path to the underlying OPML file is empty.
        /// </summary>
        /// <value><c>true</c> if the path to the underlying OPML file is empty; otherwise, <c>false</c>.</value>
        bool FilePathEmpty { get; }

        /// <summary>
        /// Gets the opml categories.
        /// </summary>
        /// <returns></returns>
        IEnumerable<XElement> GetOpmlCategories();

        /// <summary>
        /// Gets the opml resources.
        /// </summary>
        /// <param name="currentNode">The current node.</param>
        /// <returns></returns>
        IEnumerable<XElement> GetOpmlResources();

        /// <summary>
        /// Occurs when the underlying OPML file is loaded.
        /// </summary>
        event EventHandler<EventArgs> OpmlFileLoaded;
    }
}
